<%@LANGUAGE="VBSCRIPT"%>
 <!--#include file="functions.asp" -->
<%

Dim EXIREG__tmpNum
EXIREG__tmpNum = "0"
if (Request.QueryString("Seqnum") <> "") then EXIREG__tmpNum = Request.QueryString("Seqnum")
%>
<%
set EXIREG = Server.CreateObject("ADODB.Recordset")
EXIREG.ActiveConnection = cn
EXIREG.Source = "SELECT LVONUM, REGNUM, INVNUM, CREATEDBY, REQUESTEDBY, STATUS, VENDORID, INVDATE, DATEADD(DAY,30,INVDATE) AS INVDUEDATE,DUEDATE, INVRECBY,DEPT, MP2CURRENCY, SYMBOL, COMPCODE, VATNUM, WHTNAME, VATRATE, SUBTOTAL,WHTRATE, WHTAMOUNT, VATPAIDTOVENDOR,   (SELECT TOP 1 VENDOR.NAME  FROM VENDOR  WHERE VENDOR.VENDORID=EXILVOHEADER.VENDORID) AS VENDORNAME, (SELECT EMP.FIRSTNAME + ' '  + EMP.LASTNAME FROM dbo.EMP WHERE EMP.EMPCODE=EXILVOHEADER.INVRECBY) AS EMPNAME,  NOTES  FROM dbo.EXILVOHEADER  WHERE LVONUM='" + Replace(EXIREG__tmpNum, "'", "''") + "'"
'EXIREG.CursorType = 0
'EXIREG.CursorLocation = 2
'EXIREG.LockType = 3
EXIREG.Open()
EXIREG_numRows = 0
%>
<% 
'Response.Clear
'Response.ContentType = "application/vnd.ms-excel"
'Response.BinaryWrite poRsFromBll("mFtsSf135")
'Response.Flush
%>
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT>					
function DoDateTime(str, nNamedFormat, nLCID)				
	dim strRet								
	dim nOldLCID								
										
	strRet = str								
	If (nLCID > -1) Then							
		oldLCID = Session.LCID						
	End If									
										
	On Error Resume Next							
										
	If (nLCID > -1) Then							
		Session.LCID = nLCID						
	End If									
										
	If ((nLCID < 0) Or (Session.LCID = nLCID)) Then				
		strRet = FormatDateTime(str, nNamedFormat)			
	End If									
										
	If (nLCID > -1) Then							
		Session.LCID = oldLCID						
	End If									
										
	DoDateTime = strRet							
End Function									
</SCRIPT>
<html>
<head>
<title>Invoice Receipt</title>
<link rel="stylesheet" href="CAR_style.css" type="text/css">
</head>
<body bgcolor="#FFFFFF">
<table width="100%" border="0" cellspacing="2" cellpadding="3" bgcolor="#FFFFFF">
  <tr> 
    <td colspan="3" bgcolor="#FFFFFF"><b><font size="2">Invoice Receipt Note</font></b></td>
    <td bgcolor="#FFFFFF" width="15%">&nbsp;</td>
    <td bgcolor="#FFFFFF">&nbsp;</td>
    <td bgcolor="#FFFFFF"> 
      <div align="right"><img src="images/Logo_premier2.jpg" width="164" height="40"></div>
    </td>
  </tr>
  <tr> 
    <td colspan="6" bgcolor="#FFFFFF">&nbsp; </td>
  </tr>
</table>
<table width="100%" align="center" class="myTable">
  <tr> 
    <td width="35%" bgcolor="#FFFFFF">&nbsp;</td>
    <td width="2%">&nbsp;</td>
    <td width="0">&nbsp;</td>
  </tr>
  <tr> 
    <td width="35%" bgcolor="#FFFFFF" height="30"> 
      <div align="right"><i>Invoice Registration No.:</i></div>
    </td>
    <td width="2%" height="30">&nbsp;</td>
    <td width="0" height="30"> <%=(EXIREG.Fields.Item("REGNUM").Value)%> </td>
  </tr>
  <tr> 
    <td width="35%" bgcolor="#FFFFFF" height="30"> 
      <div align="right"><i>Vendor ID:</i></div>
    </td>
    <td width="2%" height="30">&nbsp;</td>
    <td width="0" height="30"> <%=(EXIREG.Fields.Item("VENDORID").Value)%> </td>
  </tr>
  <tr> 
    <td width="35%" bgcolor="#FFFFFF" height="30"> 
      <div align="right"><i>Vendor Name:</i></div>
    </td>
    <td width="2%" height="30">&nbsp;</td>
    <td width="0" height="30"> <%=(EXIREG.Fields.Item("VENDORNAME").Value)%> </td>
  </tr>
  <tr> 
    <td width="35%" bgcolor="#FFFFFF" height="30"> 
      <div align="right"><i>Vendor Invoice No.:</i></div>
    </td>
    <td width="2%" height="30">&nbsp;</td>
    <td width="0" height="30"><%=(EXIREG.Fields.Item("INVNUM").Value)%></td>
  </tr>
  <tr> 
    <td width="35%" bgcolor="#FFFFFF" height="30"> 
      <div align="right"><i>Currency:</i></div>
    </td>
    <td width="2%" height="30">&nbsp;</td>
    <td width="0" height="30"><%=(EXIREG.Fields.Item("SYMBOL").Value)%></td>
  </tr>
  <tr> 
    <td width="35%" bgcolor="#FFFFFF" height="30"> 
      <div align="right"><i>Invoice Total Amount:</i></div>
    </td>
    <td width="2%" height="30">&nbsp;</td>
    <td width="0" height="30"><%= FormatNumber((EXIREG.Fields.Item("SUBTOTAL").Value), -1, -2, -2, -1) %></td>
  </tr>
  <tr> 
    <td width="35%" bgcolor="#FFFFFF" height="30"> 
      <div align="right"><i>Received Date:</i></div>
    </td>
    <td width="2%" height="30">&nbsp;</td>
    <td width="0" height="30"><%=(EXIREG.Fields.Item("INVDATE").Value)%></td>
  </tr>
  <tr> 
    <td width="35%" bgcolor="#FFFFFF" height="30"> 
      <div align="right"><i>Invoice Received By:</i></div>
    </td>
    <td width="2%" height="30">&nbsp;</td>
    <td width="0" height="30"><%=(EXIREG.Fields.Item("EMPNAME").Value)%></td>
  </tr>
  <tr> 
    <td width="35%" bgcolor="#FFFFFF" height="30"> 
      <div align="right"><i>Estimate Latest Payment Date:</i></div>
    </td>
    <td width="2%" height="30">&nbsp;</td>
    <td width="0" height="30"><%= DoDateTime((EXIREG.Fields.Item("INVDUEDATE").Value), 2, 2070) %></td>
  </tr>
</table>
<table width="100%" class="myTable">
  <tr valign="middle"> 
    <td width="48%" bgcolor="#FFFFFF" height="63"> 
      <div align="center">Computer generated.<br>
        No sign or stamp is required.</div>
    </td>
    <td width="2%" height="63"> 
      <div align="center"><img src="images/spacer_black.gif" width="1" height="100%"></div>
    </td>
    <td height="63">This invoice receipt note shall be printed in 2 copies.<br>
      &gt; 1 copy is required for invoice data capture &amp; cataloguing<br>
      &gt; 1 copy will be given to vendor as a receipt note.</td>
  </tr>
</table>
<br>
<br>
<div align="center"> <img src="images/spacer_black.gif" width="100%" height="1"></div>
<br>
<br>
<table width="100%" border="0" cellspacing="2" cellpadding="3" bgcolor="#FFFFFF">
  <tr> 
    <td colspan="3" bgcolor="#FFFFFF"><b><font size="2">Invoice Receipt Note</font></b></td>
    <td bgcolor="#FFFFFF" width="15%">&nbsp;</td>
    <td bgcolor="#FFFFFF">&nbsp;</td>
    <td bgcolor="#FFFFFF"> 
      <div align="right"><img src="images/Logo_premier2.jpg" width="164" height="40"></div>
    </td>
  </tr>
  <tr> 
    <td colspan="6" bgcolor="#FFFFFF">&nbsp; </td>
  </tr>
</table>
<table width="100%" align="center" class="myTable">
  <tr> 
    <td width="35%" bgcolor="#FFFFFF">&nbsp;</td>
    <td width="2%">&nbsp;</td>
    <td width="0">&nbsp;</td>
  </tr>
  <tr> 
    <td width="35%" bgcolor="#FFFFFF" height="30"> 
      <div align="right"><i>Invoice Registration No.:</i></div>
    </td>
    <td width="2%" height="30">&nbsp;</td>
    <td width="0" height="30"> <%=(EXIREG.Fields.Item("REGNUM").Value)%> </td>
  </tr>
  <tr> 
    <td width="35%" bgcolor="#FFFFFF" height="30"> 
      <div align="right"><i>Vendor ID:</i></div>
    </td>
    <td width="2%" height="30">&nbsp;</td>
    <td width="0" height="30"> <%=(EXIREG.Fields.Item("VENDORID").Value)%> </td>
  </tr>
  <tr> 
    <td width="35%" bgcolor="#FFFFFF" height="30"> 
      <div align="right"><i>Vendor Name:</i></div>
    </td>
    <td width="2%" height="30">&nbsp;</td>
    <td width="0" height="30"> <%=(EXIREG.Fields.Item("VENDORNAME").Value)%> </td>
  </tr>
  <tr> 
    <td width="35%" bgcolor="#FFFFFF" height="30"> 
      <div align="right"><i>Vendor Invoice No.:</i></div>
    </td>
    <td width="2%" height="30">&nbsp;</td>
    <td width="0" height="30"><%=(EXIREG.Fields.Item("INVNUM").Value)%></td>
  </tr>
  <tr> 
    <td width="35%" bgcolor="#FFFFFF" height="30"> 
      <div align="right"><i>Currency:</i></div>
    </td>
    <td width="2%" height="30">&nbsp;</td>
    <td width="0" height="30"><%=(EXIREG.Fields.Item("SYMBOL").Value)%></td>
  </tr>
  <tr> 
    <td width="35%" bgcolor="#FFFFFF" height="30"> 
      <div align="right"><i>Invoice Total Amount:</i></div>
    </td>
    <td width="2%" height="30">&nbsp;</td>
    <td width="0" height="30"><%= FormatNumber((EXIREG.Fields.Item("SUBTOTAL").Value), -1, -2, -2, -1) %></td>
  </tr>
  <tr> 
    <td width="35%" bgcolor="#FFFFFF" height="30"> 
      <div align="right"><i>Received Date:</i></div>
    </td>
    <td width="2%" height="30">&nbsp;</td>
    <td width="0" height="30"><%=(EXIREG.Fields.Item("INVDATE").Value)%></td>
  </tr>
  <tr> 
    <td width="35%" bgcolor="#FFFFFF" height="30"> 
      <div align="right"><i>Invoice Received By:</i></div>
    </td>
    <td width="2%" height="30">&nbsp;</td>
    <td width="0" height="30"><%=(EXIREG.Fields.Item("EMPNAME").Value)%></td>
  </tr>
  <tr> 
    <td width="35%" bgcolor="#FFFFFF" height="30"> 
      <div align="right"><i>Estimate Latest Payment Date:</i></div>
    </td>
    <td width="2%" height="30">&nbsp;</td>
    <td width="0" height="30"><%= DoDateTime((EXIREG.Fields.Item("INVDUEDATE").Value), 2, 2070) %></td>
  </tr>
</table>
<table width="100%" class="myTable">
  <tr valign="middle"> 
    <td width="48%" bgcolor="#FFFFFF" height="63"> 
      <div align="center">Computer generated.<br>
        No sign or stamp is required.</div>
    </td>
    <td width="2%" height="63"> 
      <div align="center"><img src="images/spacer_black.gif" width="1" height="100%"></div>
    </td>
    <td height="63">This invoice receipt note shall be printed in 2 copies.<br>
      &gt; 1 copy is required for invoice data capture &amp; cataloguing<br>
      &gt; 1 copy will be given to vendor as a receipt note.</td>
  </tr>
</table>
<p align="center"> 
  <input type="submit" name="Submit" value="Print Receipt" onClick="window.print();window.location='Inv_DetailLVO.asp?LVONum=<%= Request.QueryString("Seqnum") %>';" class="hiddenBtn">
</p>
</body>
</html>
<%
EXIREG.Close()
%>
<SCRIPT language="JavaScript">
//window.print();
//window.location='<%= tmpurl %>';
</SCRIPT>

